#include "player.h"

Player::Player(char appearance, int x, int y) : Character(appearance, x, y) { }

bool Player::handleInput(char keystroke, int screen_width,
                         int screen_height, Map* map) {
  int x = xPos(), y = yPos();
  switch (keystroke) {
    case 'k':
        if (y > 0) --y;
        break;
    case 'j':
        if (y < screen_height) ++y;
        break;
    case 'h':
        if (x > 0) --x;
        break;
    case 'l':
        if (x < screen_width) ++x;
        break;
  }

  move(x, y);
  return true;
}
